<template>
    <Echarts class="echarts" :options="options" />
</template>

<script>
import Echarts from "../../../../../component/ECharts/index";

export default {
    components: {
        Echarts,
    },
    props: {
        reciveData: {
            // type: Object,
        },
    },
    computed: {
        options() {
            return {
                legend: {
                    itemHeight: 5,
                    textStyle: {
                        color: "rgba(255, 255, 255, 0.7)",
                    },
                },
                tooltip: {},
                dataset: {
                    source: [
                        ["product", "正常库", "病库", "险库", "危库"],
                        ["01", 43.3, 85.8, 93.7, 70.1],
                        ["02", 83.1, 73.4, 55.1, 56.1],
                        ["03", 86.4, 65.2, 82.5, 70.5],
                        ["04", 72.4, 53.9, 39.1, 40.3],
                        ["05", 83.1, 73.4, 55.1, 56.1],
                        ["06", 86.4, 65.2, 82.5, 70.5],
                    ],
                },
                grid: {
                    top: "15%",
                    left: "5%",
                    right: "5%",
                    bottom: "5%",
                    containLabel: true,
                },
                xAxis: {
                    type: "category",
                    axisLine: {
                        lineStyle: {
                            color: "#ffffff",
                        },
                    },
                    splitLine: {
                        show: true,
                        lineStyle: {
                            color: ["#6E6E6E"],
                            width: 1,
                            type: "solid",
                        },
                    },
                },
                yAxis: {
                    axisLine: {
                        lineStyle: {
                            color: "#ffffff",
                        },
                    },
                    splitLine: {
                        show: true,
                        lineStyle: {
                            color: ["#6E6E6E"],
                            width: 1,
                            type: "solid",
                        },
                    },
                },

                // Declare several bar series, each will be mapped
                // to a column of dataset.source by default.
                series: [
                    {
                        type: "bar",
                        itemStyle: {
                            // normal: {
                            borderRadius: 20,
                            color: {
                                type: "linear",
                                x: 0,
                                y: 0,
                                x2: 1,
                                y2: 1,
                                colorStops: [
                                    {
                                        offset: 0,
                                        color: "#06F2F1",
                                    },
                                    {
                                        offset: 1,
                                        color: " #02529F",
                                    },
                                ],
                            },
                            // },
                        },
                    },
                    {
                        type: "bar",
                        itemStyle: {
                            // normal: {
                            borderRadius: 20,
                            color: {
                                type: "linear",
                                x: 0,
                                y: 0,
                                x2: 1,
                                y2: 1,
                                colorStops: [
                                    {
                                        offset: 0,
                                        color: "#E19C31",
                                    },
                                    {
                                        offset: 1,
                                        color: "#FDFD0B",
                                    },
                                ],
                            },
                            // },
                        },
                    },
                    {
                        type: "bar",
                        itemStyle: {
                            // normal: {
                            borderRadius: 20,
                            color: {
                                type: "linear",
                                x: 0,
                                y: 0,
                                x2: 1,
                                y2: 1,
                                colorStops: [
                                    {
                                        offset: 0,
                                        color: "#FF675A",
                                    },
                                    {
                                        offset: 1,
                                        color: "#FFC15A",
                                    },
                                ],
                            },
                            // },
                        },
                    },
                    {
                        type: "bar",
                        itemStyle: {
                            // normal: {
                            borderRadius: 20,
                            color: {
                                type: "linear",
                                x: 0,
                                y: 0,
                                x2: 1,
                                y2: 1,
                                colorStops: [
                                    {
                                        offset: 0,
                                        color: "#D33325",
                                    },
                                    {
                                        offset: 1,
                                        color: "#FF675A",
                                    },
                                ],
                            },
                            // },
                        },
                    },
                ],
            };
        },
    },
};
</script>

<style></style>
